#ifndef _BMP_STEG
#define _BMP_STEG

#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<iostream.h>

#define BMP_HEADER 54
#define BMP_OFFSET 822
#define STX 0x2
#define ETX 0x3

/* ERROR CODES */
#define ERR_BF  1 // Bad Filename
#define ERR_FNF 2 // File not found
#define ERR_M2B 3 // Message too big
#define ERR_URH 4 // Unable to read header (bad fread)
#define ERR_WRE 5 // Write error (Unable to write to file)
#define ERR_BMP 6 // Invalid BMP to encode
#define SUCCESS 7
#define ERR_NM  8 // No messsage present

struct bmpHeaderType
{
	char c1, c2;		// identify "BM"
	long fileSize;		// size of file in bytes
	long reserved;		// always 0
	long pixelOffset;		// offset of data
	long bmiSize;		// remaining size of header in file
	long cols, rows;		// width and height of image
	int  nPlanes;		// number of color planes (must be 1)
	int  bitsPerPixel;		// number of bits used to represent a pixel
	long compression, cmpSize;	// compressed image? (compression = 0)
	long xScale, yScale;
	long colors, impColors;
};

/* Functions */

int validBMP(char *); // Checks if it is a valid 8/24 bit BMP
long maxEncodeBMP(FILE *); // Returns the maximum encodable size of message
long fileSize(FILE *fp); // Returns the filesize
int encodeBMP(char *, char *, char *); // Encodes a message file into a 8 bit BMP
int decodeBMP(char *, char *); // Decodes encoded 8/24 bit BMP
void displayInfo(char *);
void bmpInfo(bmpHeaderType); // Lists the Header info
int encodeBMP24(char *, char *, char *); // Encodes into a 24 bit BMP
char decodeChar(FILE *fp, long pos); // Decodes a message byte
long encodeChar(FILE *source, long Off, FILE *target, char c);
			// Encodes a single message byte in 8 image bytes

#endif